package net.lookyou.log.controller;

import net.lookyou.log.service.TestService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

    private final Logger logger = LoggerFactory.getLogger(this.getClass());

    @Autowired
    private TestService testService;

    @GetMapping(value = "/test")
    public void test(){
        //打印trace和debug
        logger.trace("trace信息");
        logger.debug("debug信息");
        logger.warn("warn信息");
        logger.info("info信息");
        logger.error("error信息");

        testService.sayHi();
    }
}
